// @flow
import * as React from 'react';
import '../static/css/input-frame.css';
import { Input } from 'antd';

const Search = Input.Search;
export default class InputFrame extends React.Component<Props> {

  constructor(props) {
    super(props)

    this.state = {
      placeholder: this.props.placeholder,
      accountSignText: this.props.accountSign,
    }
  }

  render() {
    var accountSign
    if (this.state.accountSignText) {
      accountSign = <div className="accountSign">{this.state.accountSignText}</div>
    } else {
      accountSign = ''
    }

    return (
      <div className="input-frame">
        {accountSign}
        <Search
          placeholder={this.state.placeholder}
          onSearch={this.props.enterInput}
        />
      </div>
    );
  }
}
